<div class="user-center">
  <div class="header">
    个人中心
    <!-- <div class="message-switch">
      消息推送开关
      <el-switch
        v-model="msgSwitch"
        on-text=""
        off-text=""
        :on-value="'true'"
        :off-value="'false'">
      </el-switch>
    </div> -->
  </div>
  <div class="page-left">
    <div class="user-info">
      <div class="fee-mob-title">
        基本资料
      </div>
      <div class="pic">
        <img :src="userInfoForm.headUrl || '/3.0/nopictues_user.png'" alt="">
      </div>
      <el-upload
        class="upload"
        :action="uploadUrl"
        name="fmc_storage_file"
        :show-file-list="false"
        :on-success="handleAvatarSuccess">
        <el-button size="small" type="text">上传头像</el-button>
      </el-upload>
      <stm-form
        label-width="90px"
        :row-size="1"
        :is-close="false"
        :item-info="userInfo"
        :form="userInfoForm"
        :rules="userInfoRules"
        submit-text="保存资料"
        :is-cancel="false"
        @submit="updateUserInfo"
        @show-password="showOrHidePWD"
        @hide-password="showOrHidePWD">
        <template slot="btnList">
          <el-button @click.native="passwordVisible = true">修改密码</el-button>
        </template>
      </stm-form>
    </div>
  </div>
  <div class="page-right">
    <div class="bank-info">
      <div class="fee-mob-title">
        银行账号
        <span class="glyphicon icon-plus pull-right" @click="addBankInfo"></span>
      </div>
      <stm-table
        :table-column="bankTableColumn"
        :table-data="bankTableData"
        :is-pagination="false"
        :is-sortable="false">
        <template slot="default" scope="scope">
          <span>{{scope.row.isDefault === '000' ? '默认': ''}}</span>
        </template>
        <template slot="bankOper" scope="scope">
          <el-button type="text" @click.native="updateBankAccountDefault(scope.row)">设为默认</el-button>
          <el-button type="text" @click.native="editBankInfo(scope.row)">修改</el-button>
          <el-button type="text" @click.native="deleteBankAccountInfo(scope.row)">删除</el-button>
        </template>
      </stm-table>
    </div>
    <div class="dept-info">
      <div class="fee-mob-title">
        所属部门
      </div>
      <stm-table
        :table-column="deptTableColumn"
        :table-data="deptTableData"
        :is-pagination="false"
        :is-sortable="false">
        <template slot="now" scope="scope">
          <span>{{scope.row.isNowDept === 'Y' ? '当前部门': ''}}</span>
        </template>
        <template slot="default" scope="scope">
          <span>{{scope.row.isDefault === 'Y' ? '默认': ''}}</span>
        </template>
        <template slot="deptOper" scope="scope">
          <el-button type="text" @click.native="updateDept(scope.row)">设为默认</el-button>
          <el-button type="text" @click.native="switchDepatement(scope.row)">切换</el-button>
        </template>
      </stm-table>
      <!-- <div class="leader">直属领导： {{leader}}</div> -->
    </div>
  </div>

  <!-- 银行帐号弹窗 -->
  <bank-add-dialog
    :bank-visible="bankDialogVisible"
    :title="bankTitle"
    :bank-form="bankForm"
    @submit-info="updateBankInfo"
    @close-dialog="bankDialogVisible = false">
  </bank-add-dialog>

  <!-- 修改密码弹窗 -->
  <!-- <el-dialog
    size="tiny"
    title="修改密码"
    v-model="passwordVisible">
    <stm-form
      name="pwForm"
      :item-info="pwItemInfo"
      :form="pwForm"
      :rules="pwRules"
      @submit="changePassword">
    </stm-form>
  </el-dialog> -->
  <el-dialog
  size="tiny"
  title="修改密码"
  v-model="passwordVisible">
  <el-form :model="pwForm">
    <el-form-item label="旧密码" :label-width="formLabelWidth">
      <el-input type="password" v-model="pwForm.oldPwd" auto-complete="off" ></el-input>
    </el-form-item>
    <el-form-item label="新密码" :label-width="formLabelWidth">
      <el-input type="password" v-model="pwForm.firstPwd" auto-complete="off"></el-input>
    </el-form-item>
    <el-form-item label="确认密码" :label-width="formLabelWidth">
      <el-input type="password" v-model="pwForm.secondPwd" auto-complete="off"></el-input>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="passwordVisible = false">取 消</el-button>
    <el-button type="primary" @click="changePassword">确 定</el-button>
  </div>
</el-dialog>
</div>
